package gitee

import "time"

type V8EnterpriseList struct {
	TotalCount int64          `json:"total_count"`
	Data       []V8Enterprise `json:"data"`
}

type V8Owner struct {
	ID                 int64       `json:"id"`
	Login              string      `json:"login"`
	Username           string      `json:"username"`
	Name               string      `json:"name"`
	AvatarURL          string      `json:"avatar_url"`
	State              string      `json:"state"`
	CreatedAt          time.Time   `json:"created_at"`
	UpdatedAt          time.Time   `json:"updated_at"`
	UserColor          interface{} `json:"user_color"`
	AuthenWay          string      `json:"authen_way"`
	Email              string      `json:"email"`
	NeedChangePassword bool        `json:"need_change_password"`
}

type V8Enterprise struct {
	ID                int64       `json:"id"`
	Name              string      `json:"name"`
	Path              string      `json:"path"`
	Description       string      `json:"description"`
	Public            bool        `json:"public"`
	Website           string      `json:"website"`
	Email             string      `json:"email"`
	Phone             string      `json:"phone"`
	AvatarURL         string      `json:"avatar_url"`
	Level             int64       `json:"level"`
	Title             string      `json:"title"`
	Owner             V8Owner     `json:"owner"`
	Notice            string      `json:"notice"`
	WelcomeMessage    interface{} `json:"welcome_message"`
	ForceVerify       bool        `json:"force_verify"`
	DefaultRoleID     int64       `json:"default_role_id"`
	OpenApplication   bool        `json:"open_application"`
	Version           int64       `json:"version"`
	StartAt           time.Time   `json:"start_at"`
	StopAt            time.Time   `json:"stop_at"`
	Overdue           bool        `json:"overdue"`
	Charged           bool        `json:"charged"`
	CreatedAt         time.Time   `json:"created_at"`
	UpdatedAt         time.Time   `json:"updated_at"`
	Watermark         bool        `json:"watermark"`
	GiteeSearchStatus string      `json:"gitee_search_status"`
	HasHedgeOrder     bool        `json:"has_hedge_order"`
	LdapEnabled       bool        `json:"ldap_enabled"`
	RegisterEnabled   bool        `json:"register_enabled"`
}

type V8EnterpriseMemberList struct {
	TotalCount int64                `json:"total_count"`
	Data       []V8EnterpriseMember `json:"data"`
}

type V8User struct {
	ID                 int64       `json:"id"`
	Login              string      `json:"login"`
	Username           string      `json:"username"`
	Name               string      `json:"name"`
	AvatarURL          string      `json:"avatar_url"`
	State              string      `json:"state"`
	CreatedAt          time.Time   `json:"created_at"`
	UpdatedAt          time.Time   `json:"updated_at"`
	UserColor          interface{} `json:"user_color"`
	AuthenWay          string      `json:"authen_way"`
	Email              string      `json:"email"`
	NeedChangePassword bool        `json:"need_change_password"`
}

type V8EnterpriseRole struct {
	ID              int64  `json:"id"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	IsSystemDefault bool   `json:"is_system_default"`
	Ident           string `json:"ident"`
	IsDefault       bool   `json:"is_default"`
}

type V8EnterpriseMember struct {
	ID                     int64            `json:"id"`
	Username               string           `json:"username"`
	Name                   string           `json:"name"`
	Remark                 string           `json:"remark"`
	Pinyin                 string           `json:"pinyin"`
	Occupation             string           `json:"occupation"`
	IsBlock                bool             `json:"is_block"`
	BlockMessage           interface{}      `json:"block_message"`
	Phone                  string           `json:"phone"`
	Email                  string           `json:"email"`
	User                   V8User           `json:"user"`
	EnterpriseRole         V8EnterpriseRole `json:"enterprise_role"`
	CreatedAt              time.Time        `json:"created_at"`
	FeedbackTime           interface{}      `json:"feedback_time"`
	IsFeedback             interface{}      `json:"is_feedback"`
	IsGuided               bool             `json:"is_guided"`
	UserGuideClosed        bool             `json:"user_guide_closed"`
	UserGuideStepsFinished interface{}      `json:"user_guide_steps_finished"`
	Department             string           `json:"department"`
	CanRemove              bool             `json:"can_remove"`
}

type V8GroupList struct {
	TotalCount int64     `json:"total_count"`
	Data       []V8Group `json:"data"`
}

type V8Group struct {
	ID                 int64     `json:"id"`
	Name               string    `json:"name"`
	Path               string    `json:"path"`
	AvatarURL          string    `json:"avatar_url"`
	Description        string    `json:"description"`
	GroupType          int64     `json:"group_type"`
	GroupTypeHumanName string    `json:"group_type_human_name"`
	Public             int64     `json:"public"`
	Creator            V8Creator `json:"creator"`
	CreatedAt          time.Time `json:"created_at"`
	UpdatedAt          time.Time `json:"updated_at"`
	MembersCount       int64     `json:"members_count"`
	CanEdit            bool      `json:"can_edit"`
}

type V8GroupDetail struct {
	Id                 int64     `yaml:"id"`
	Description        string    `yaml:"description"`
	GroupType          int64     `yaml:"group_type"`
	UpdatedAt          string    `yaml:"updated_at"`
	RelateProjectCount int64     `yaml:"relate_project_count"`
	Public             int64     `yaml:"public"`
	RelateProgramCount int64     `yaml:"relate_program_count"`
	SubGroupCount      int64     `yaml:"sub_group_count"`
	HasChildren        bool      `yaml:"has_children"`
	CanEdit            bool      `yaml:"can_edit"`
	ProjectCount       int64     `yaml:"project_count"`
	Name               string    `yaml:"name"`
	Path               string    `yaml:"path"`
	AvatarUrl          string    `yaml:"avatar_url"`
	Creator            V8Creator `yaml:"creator"`
	GroupTypeHumanName string    `yaml:"group_type_human_name"`
	CreatedAt          string    `yaml:"created_at"`
	MembersCount       int64     `yaml:"members_count"`
}

type V8GroupMemberList struct {
	TotalCount int64           `json:"total_count"`
	Data       []V8GroupMember `json:"data"`
}

type V8GroupMember struct {
	ID                     int64            `json:"id"`
	Username               string           `json:"username"`
	Name                   string           `json:"name"`
	Remark                 interface{}      `json:"remark"`
	Pinyin                 string           `json:"pinyin"`
	Occupation             string           `json:"occupation"`
	IsBlock                bool             `json:"is_block"`
	BlockMessage           interface{}      `json:"block_message"`
	Phone                  string           `json:"phone"`
	Email                  string           `json:"email"`
	User                   V8User           `json:"user"`
	EnterpriseRole         V8EnterpriseRole `json:"enterprise_role"`
	CreatedAt              time.Time        `json:"created_at"`
	FeedbackTime           time.Time        `json:"feedback_time"`
	IsFeedback             bool             `json:"is_feedback"`
	IsGuided               bool             `json:"is_guided"`
	UserGuideClosed        bool             `json:"user_guide_closed"`
	UserGuideStepsFinished []string         `json:"user_guide_steps_finished"`
	Department             string           `json:"department"`
	CanRemove              bool             `json:"can_remove"`
}

type V8RepoMemberList struct {
	TotalCount int64          `json:"total_count"`
	Data       []V8RepoMember `json:"data"`
}

type V8RepoMember struct {
	ID                 int64     `json:"id"`
	Name               string    `json:"name"`
	Nickname           string    `json:"nickname"`
	Username           string    `json:"username"`
	Target             string    `json:"target"`
	AvatarURL          string    `json:"avatar_url"`
	Email              string    `json:"email"`
	IsEnterpriseMember bool      `json:"is_enterprise_member"`
	IsHistoryMember    bool      `json:"is_history_member"`
	AccessLevel        string    `json:"access_level"`
	AccessLevelIdent   string    `json:"access_level_ident"`
	IsBlocked          bool      `json:"is_blocked"`
	IsMyself           bool      `json:"is_myself"`
	ProjectAccess      int64     `json:"project_access"`
	ProjectAccessName  string    `json:"project_access_name"`
	ProjectCreator     bool      `json:"project_creator"`
	ProjectOwner       bool      `json:"project_owner"`
	JoinAt             time.Time `json:"join_at"`
}

type V8LabelList struct {
	TotalCount int64     `json:"total_count"`
	Data       []V8Label `json:"data"`
}

type V8Label struct {
	ID            int64     `json:"id"`
	Name          string    `json:"name"`
	Color         string    `json:"color"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	MigrateStatus int64     `json:"migrate_status"`
}

type V8ProtectBranchSettingList struct {
	TotalCount               int64                    `json:"total_count"`
	AllBranchesCount         int64                    `json:"all_branches_count"`
	ActiveBranchesCount      interface{}              `json:"active_branches_count"`
	StaleBranchesCount       interface{}              `json:"stale_branches_count"`
	CreatedByMeBranchesCount interface{}              `json:"created_by_me_branches_count"`
	DeletedBranchesCount     interface{}              `json:"deleted_branches_count"`
	Data                     []V8ProtectBranchSetting `json:"data"`
}

// value为1时，是保护分支，需要解析ProtectionRule
// value为0时，是普通分支，不需要解析ProtectionRule
type V8BranchType struct {
	Value int64  `json:"value"`
	Name  string `json:"name"`
}

type V8ProtectionRule struct {
	ID                 int64         `json:"id"`
	ProjectID          int64         `json:"project_id"`
	Wildcard           string        `json:"wildcard"`
	Pusher             string        `json:"pusher"`
	Merger             string        `json:"merger"`
	CreatedAt          time.Time     `json:"created_at"`
	UpdatedAt          time.Time     `json:"updated_at"`
	Mode               int64         `json:"mode"`
	Strict             interface{}   `json:"strict"`
	Contexts           []interface{} `json:"contexts"`
	RequireAllResolved bool          `json:"require_all_resolved"`
}

type V8ProtectBranchSettingAuthor struct {
	Name             string `json:"name"`
	Email            string `json:"email"`
	ImagePath        string `json:"image_path"`
	IsGiteeUser      bool   `json:"is_gitee_user"`
	Username         string `json:"username"`
	IsEnterpriseUser bool   `json:"is_enterprise_user"`
}

type V8Committer struct {
	Name             string `json:"name"`
	Email            string `json:"email"`
	ImagePath        string `json:"image_path"`
	IsGiteeUser      bool   `json:"is_gitee_user"`
	Username         string `json:"username"`
	IsEnterpriseUser bool   `json:"is_enterprise_user"`
}

type V8Commit struct {
	ID                  string                       `json:"id"`
	ShortID             string                       `json:"short_id"`
	Title               string                       `json:"title"`
	TitleMarkdown       string                       `json:"title_markdown"`
	Description         interface{}                  `json:"description"`
	DescriptionMarkdown string                       `json:"description_markdown"`
	Message             string                       `json:"message"`
	MessageMarkdown     string                       `json:"message_markdown"`
	Author              V8ProtectBranchSettingAuthor `json:"author"`
	Committer           V8Committer                  `json:"committer"`
	AuthoredDate        time.Time                    `json:"authored_date"`
	Signature           interface{}                  `json:"signature"`
	BuildState          interface{}                  `json:"build_state"`
}

type V8Operating struct {
	MultipleDestroy     bool `json:"multiple_destroy"`
	SetStatus           bool `json:"set_status"`
	EnterpriseForbidZip bool `json:"enterprise_forbid_zip"`
	DownloadCode        bool `json:"download_code"`
	SetDefaultBranch    bool `json:"set_default_branch"`
	SetBranchOwner      bool `json:"set_branch_owner"`
	Destroy             bool `json:"destroy"`
	Update              bool `json:"update"`
}

type V8ProtectBranchSetting struct {
	Name           string           `json:"name"`
	BranchType     V8BranchType     `json:"branch_type"`
	IsDefault      bool             `json:"is_default"`
	ProtectionRule V8ProtectionRule `json:"protection_rule"`
	Commit         V8Commit         `json:"commit"`
	Operating      V8Operating      `json:"operating"`
	PullRequest    interface{}      `json:"pull_request"`
	Remark         string           `json:"remark"`
	Owner          V8Owner          `json:"owner"`
}

type V8RepositoryDetail struct {
	ID                    int64                       `json:"id"`
	Name                  string                      `json:"name"`
	Path                  string                      `json:"path"`
	PathWithNamespace     string                      `json:"path_with_namespace"`
	NameWithNamespace     string                      `json:"name_with_namespace"`
	Description           string                      `json:"description"`
	License               interface{}                 `json:"license"`
	Lang                  Lang                        `json:"lang"`
	CloneWays             CloneWays                   `json:"clone_ways"`
	OpenIssueCount        int64                       `json:"open_issue_count"`
	NotFinishedIssueCount int64                       `json:"not_finished_issue_count"`
	CloseIssueCount       int64                       `json:"close_issue_count"`
	TotalPrCount          int64                       `json:"total_pr_count"`
	RepoSize              int64                       `json:"repo_size"`
	WikiCount             int64                       `json:"wiki_count"`
	AttchmentCount        int64                       `json:"attchment_count"`
	MembersCount          int64                       `json:"members_count"`
	RepoSizeRefresh       RepoSizeRefresh             `json:"repo_size_refresh"`
	Namespace             V8RepositoryDetailNamespace `json:"namespace"`
	DefaultBranch         string                      `json:"default_branch"`
	Homepage              string                      `json:"homepage"`
	IsWaitFork            bool                        `json:"is_wait_fork"`
	DisplayBranchMode     bool                        `json:"display_branch_mode"`
	Template              interface{}                 `json:"template"`
	CanExecGiteeScan      bool                        `json:"can_exec_gitee_scan"`
}

type Lang struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Ident string `json:"ident"`
}

type CloneWays struct {
	HTTPSURL     string      `json:"https_url"`
	SSHURL       string      `json:"ssh_url"`
	SvnURL       interface{} `json:"svn_url"`
	SvnAndSSHURL interface{} `json:"svn_and_ssh_url"`
}

type CoolDownTime struct {
	Hours   int64 `json:"hours"`
	Minutes int64 `json:"minutes"`
}

type RepoSizeRefresh struct {
	Refreshing   bool         `json:"refreshing"`
	CoolDownTime CoolDownTime `json:"cool_down_time"`
	RestCount    int64        `json:"rest_count"`
	Status       string       `json:"status"`
}

type V8RepositoryDetailNamespace struct {
	ID           int64  `json:"id"`
	Type         string `json:"type"`
	Name         string `json:"name"`
	Path         string `json:"path"`
	CompleteName string `json:"complete_name"`
	CompletePath string `json:"complete_path"`
}
